#include "DeaconsWidget.h"

void DeaconsWidget::loadEducation()
{
	education1->setText(QString("%1").arg(m_youth->deacons().education().req1()));
	education2->setText(QString("%1").arg(m_youth->deacons().education().req2()));
	education3->setText(QString("%1").arg(m_youth->deacons().education().req3()));
	education4->setText(QString("%1").arg(m_youth->deacons().education().req4()));
	education5->setText(QString("%1").arg(m_youth->deacons().education().req5()));
	education6->setText(QString("%1").arg(m_youth->deacons().education().req6()));
	education7->setText(QString("%1").arg(m_youth->deacons().education().req7()));
	education8->setText(QString("%1").arg(m_youth->deacons().education().req8()));
	education9->setText(QString("%1").arg(m_youth->deacons().education().req9()));
	education10->setText(QString("%1").arg(m_youth->deacons().education().req10()));
	education11->setText(QString("%1").arg(m_youth->deacons().education().req11()));
	education12->setText(QString("%1").arg(m_youth->deacons().education().req12()));
	education13->setText(QString("%1").arg(m_youth->deacons().education().req13()));
}

void DeaconsWidget::on_education1_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq1(percent);
	updateCompletions();
}

void DeaconsWidget::on_education2_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq2(percent);
	updateCompletions();
}

void DeaconsWidget::on_education3_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq3(percent);
	updateCompletions();
}

void DeaconsWidget::on_education4_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq4(percent);
	updateCompletions();
}

void DeaconsWidget::on_education5_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq5(percent);
	updateCompletions();
}

void DeaconsWidget::on_education6_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq6(percent);
	updateCompletions();
}

void DeaconsWidget::on_education7_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq7(percent);
	updateCompletions();
}

void DeaconsWidget::on_education8_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq8(percent);
	updateCompletions();
}

void DeaconsWidget::on_education9_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq9(percent);
	updateCompletions();
}

void DeaconsWidget::on_education10_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq10(percent);
	updateCompletions();
}

void DeaconsWidget::on_education11_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq11(percent);
	updateCompletions();
}

void DeaconsWidget::on_education12_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq12(percent);
	updateCompletions();
}

void DeaconsWidget::on_education13_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().education().setReq13(percent);
	updateCompletions();
}

